package com.demo5;

/**
 * Created by Administrator on 2017/3/26.
 */
class Animal3 {
    String type;
    String name;
    int age;
    int weight;

    void eat() {
        System.out.println("animal eat");
    }

    void breath() {
        System.out.println("animal breath");
    }

    void sleep() {
        System.out.println("animal sleep");
    }
}

class Tiger3 extends Animal3 {
    String tigerTyre;
    String from;

    void tigerRun() {
        System.out.println("老虎在奔跑");
    }

    void breath() {
        System.out.println("老虎是用肺呼吸的");
    }

}

class Fish3 extends Animal3 {
    String fishType;

    void swim() {
        System.out.println("鱼在游泳");
    }

    void breath() {
        System.out.println("鱼是用腮呼吸的");
    }
}

public class JiCheng4 {
    public static void main(String[] args) {
        Animal3[] animal3 = new Animal3[3];
        animal3[0] = new Animal3();
        animal3[1] = new Tiger3();
        animal3[2] = new Fish3();
        animal3[0].breath();
        animal3[1].breath();
        animal3[2].breath();
    }
}
